<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 引入css文件 -->
    <link rel="stylesheet" href="./移动端首页.css">
    <!-- 轮播图 -->
    <link rel="stylesheet" href="https://unpkg.com/swiper@8/swiper-bundle.min.css">
    <script src="https://unpkg.com/swiper@8/swiper-bundle.min.js"> </script>
    <!-- 引入jq -->
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
</head>

<body>
    <!-- 顶部 -->
    <div class="title">
        <h4>宝瑞通典当行</h4>
    </div>
    <!-- 搜索框 -->
    <div class="title1">
        <input type="text" placeholder="搜索">
    </div>
    <!-- 轮播图 -->
    <div class="swiper mySwiper swiper-initialized swiper-horizontal swiper-pointer-events swiper-backface-hidden">
        <div class="swiper-wrapper" id="swiper-wrapper-72d81ecf210966ec9" aria-live="off"
            style="transition-duration: 0ms; transform: translate3d(-2420px, 0px, 0px);">
        </div>
    </div>

    <!-- 文字滚动 -->
    <!-- <div class="scroll"> -->
        <div class="swiper mySwiper2" id="main1">
            <div class="swiper-wrapper">
                <div class="swiper-slide"><span>寥落古行宫</span></div>
                <div class="swiper-slide"><span>宫花寂寞红</span> </div>
                <div class="swiper-slide"><span>白头宫女在</span> </div>
                <div class="swiper-slide"><span>闲坐说玄宗</span> </div>

            </div>
        </div>
    <!-- </div> -->
    <!-- 内容部分 -->
    <div class="main">
        <ul>
            <li>典当借款</li>
            <li>卖掉变现</li>
            <li>鉴定评估</li>
            <li>续期赎回</li>
            <li>保管箱</li>
        </ul>
    </div>

    <!-- 底部 -->
    <div class="footer">
        <ul>
            <li><a href="./移动端我.html">首页</a></li>
            <li><a href="">流程</a></li>
            <li><a href="">业务</a></li>
            <li><a href="./移动端我.html">我</a></li>
        </ul>
    </div>
</body>
<script>
    // 轮播图
    var swiper = new Swiper(".mySwiper", {
        spaceBetween: 30,
        centeredSlides: true,
        autoplay: {
            delay: 2500,
            disableOnInteraction: false,
        },
        pagination: {
            el: ".swiper-pagination",
            clickable: true,
        },
        navigation: {
            nextEl: ".swiper-button-next",
            prevEl: ".swiper-button-prev",
        },
    });

    var swiper1 = new Swiper(".mySwiper2", {
        direction: "vertical",
        slidesPerView: 1,
        spaceBetween: 30,
        mousewheel: true,
        loop: true, //循环
        autoplay: {
            disableOnInteraction: false,  //触碰后自动轮播也不会停止
            delay: 1500,
        }
    });
    // 页面加载
    $(function () {
        // 轮播图
        $.ajax({
            url: 'http://47.94.4.201/index.php/index/index/getImgList',
            type: 'get',
            dataType: 'json',
            success: function (res) {
                console.log(res);
                let str = ''
                for (let i in res.data) {
                    str += `<div class="swiper-slide" role="group" aria-label="4 / 9" style="width: 454px; margin-right: 30px;">
                                    <img src="${res.data[i]}" alt="">
                                </div>`
                }
                $('#swiper-wrapper-72d81ecf210966ec9').html(str)
            }
        })
    })
</script>

</html>